package com.dongdongshop.controller;

import com.alibaba.dubbo.config.annotation.Reference;
import com.dongdongshop.data.Result;
import com.dongdongshop.em.ResultEnum;
import com.dongdongshop.pojo.TbContent;
import com.dongdongshop.service.ContentService;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;
import sun.misc.Contended;

import java.util.ArrayList;
import java.util.List;

@Controller
@RequestMapping("content")
public class ContentController {
    @Reference
    private ContentService contentService;

    @RequestMapping("getShuff")
    @ResponseBody
    public Result getShuff(Long categoryId){
        List<TbContent> shuffList = contentService.selectShuff(categoryId);
        return Result.response(ResultEnum.SUCCESS).setData(shuffList);
    }
    @RequestMapping("getDayList")
    @ResponseBody
    public Result getDayList(Long categoryId){
        List<TbContent> getDayList = contentService.getDayList(categoryId);
        return Result.response(ResultEnum.SUCCESS).setData(getDayList);
    }
    @RequestMapping("getLikeList")
    @ResponseBody
    public Result getLikeList(Long categoryId){
        List<TbContent> getLikeList = contentService.getLikeList(categoryId);
        return Result.response(ResultEnum.SUCCESS).setData(getLikeList);
    }


}
